#! /bin/bash

set -euE

# Create an http server for files in /var/www/html directory
cat <<'EOF' > $target/etc/nginx/conf.d/static-file-server.conf 
server {
  listen  80;
  listen [::]:80;
  server_name _;
  root /var/www/html;
  autoindex on;
  location / {
    try_files $uri $uri/ =404;
  }
}
EOF

# Remove default nginx http server
echo "" > $target/etc/nginx/sites-available/default
